﻿@model MvcGMaps.Models.Marker
@using MvcGMaps.Utils
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" aria-hidden="true" data-dismiss="modal">&times;</button>
            <h4 class="modal-title" id="markerModalLabel">Происшествие</h4>
        </div>
        <div class="modal-body">
            @using (Html.BeginForm("Edit", "Home", FormMethod.Post, new { @class = "form-horizontal", @id = "editForm", @role = "form" }))
            {   
                @Html.AntiForgeryToken()
                <fieldset>
                    @Html.HiddenFor(m => m.MarkerID)
                    @Html.HiddenFor(m => m.Latitude)
                    @Html.HiddenFor(m => m.Longitude)
                    <div class="form-group input-group-sm">
                        @Html.LabelFor(m => m.TypeID, "Тип: ", new { @class = "control-label" })
                        @Html.DropDownListFor(m => m.TypeID, (SelectList)ViewData["TypeDDL"], new { @class = "form-control input-sm" })
                    </div>
                    @Html.ValidationMessageFor(m => m.TypeID)

                    <div class="form-group input-group-sm">
                        @Html.LabelFor(m => m.StatusID, "Статус: ", new { @class = "control-label" })
                        @Html.DropDownList("StatusID", (SelectList)ViewData["StatusDDL"], new { @class = "form-control input-sm" })
                    </div>
                    @Html.ValidationMessageFor(m => m.StatusID)
                    @Html.InputDate("Дата:", "datepicker", "AddedDate", Model.AddedDate.ToShortDateString(), true)
                    @Html.ValidationMessageFor(m => m.AddedDate)
                    <div class="form-group">
                        @Html.TextAreaFor(m => m.Commentary, new { @class = "form-control input-sm", @rows = "3", @placeholder = "Комментарий" })
                    </div>
                    @Html.ValidationMessageFor(m => m.Commentary)
                </fieldset>
            }
        </div>
        @if (Request.IsAuthenticated)
        {
        <div class="modal-footer">
            <div class="btn-group-sm">
                <button type="button" id="saveBtn" class="btn btn-sm btn-primary btn-block" aria-hidden="true" onclick="updateMarker()">Сохранить</button>
            </div>
        </div>
        }
    </div>
</div>